package edu.sctu.wujiayi.month05.day20150512;

/**
 * Created by user11 on 2015/5/12.
 */
public class AbstractSeven extends AbstractFive implements InterfaceOne {

    public AbstractSeven(AbstractEight[] a) {
        super(a);
    }

    private AbstractEight[] b = new AbstractEight[a.length];

    @Override
    public AbstractEight[] getInformation() {
        int m = 0;
        for (int i = 0; i < a.length; i++) {
            if (a[i].getGrade() > 60 && a[i].getSex().equals("男" + i)) {
                m++;
//                System.out.println(a[i].getGrade());
//                System.out.println(a[i].getName());
//                System.out.println(a[i].getAge());
//                System.out.println(a[i].getNumber());
//                System.out.println(a[i].getSex());
//                System.out.println(a[i].getAddress());
                b[i] = a[i];
            }
        }
        System.out.println(m);


        return b;
    }


    @Override
    public AbstractEight[] judgeMent(int age) {
        int n = 0;
        for (int i = 0; i < a.length; i++) {

            if (a[i].getAge() > age) {
                n++;
                System.out.println(a[i].getName());
            }
        }
        System.out.println("年龄大于22的人为：" + n);
        return a;
    }

}
